package com.ytf.test.seventh;

/**
 * @author: YTF
 * @date: 2024/9/27 12:13
 * @version: 1.0
 * @description: 继承
 */
public class Cartoon extends Drawing{
    public Cartoon() {
        System.out.println(" Cartoon constructor");
    }
    public Cartoon(int i) {
        super(i);
        System.out.println(" Cartoon(int i) constructor");
    }
    // private static Cartoon cartoon = new Cartoon();

    public static void main(String[] args) {
        new Cartoon();
        new Cartoon(1);
        /**
         * Output:
         *  Art constructor
         *  Drawing constructor
         *  Cartoon constructor
         *  Art(int i) constructor
         *  Drawing(int i) constructor
         *  Cartoon(int i) constructor
         */
    }
}
class Drawing extends Art{
    public Drawing() {
        System.out.println(" Drawing constructor");
    }
    public Drawing(int i) {
        super(i);
        System.out.println(" Drawing(int i) constructor");
    }
}
class Art{
    public Art() {
        System.out.println(" Art constructor");
    }
    public Art(int i) {
        System.out.println(" Art(int i) constructor");
    }
}
